package cn.sfrog.project.biz.admin.service;

import cn.sfrog.common.core.domain.entity.SysUser;
import cn.sfrog.project.biz.admin.domain.BizUserEnsureMoney;
import cn.sfrog.project.biz.admin.domain.BizUserRechargePayment;
import cn.sfrog.project.biz.admin.domain.vo.BizUserRechargePaymentFormVO;
import cn.sfrog.project.biz.admin.domain.vo.BizUserRechargePaymentQueryVO;
import cn.sfrog.project.biz.admin.domain.vo.BizUserRechargePaymentVO;
import cn.sfrog.project.biz.web.vo.account.AppUserRechargeFormVO;
import cn.sfrog.system.domain.vo.BizStatusChangeVO;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Date;
import java.util.List;

/**
 * 支付Service接口
 */
public interface IBizUserRechargePaymentService extends IService<BizUserRechargePayment> {
    /**
     * 查询支付
     *
     * @param id 支付主键
     * @return 支付
     */
    public BizUserRechargePaymentVO selectBizUserRechargePaymentById(Long id);

    /**
     * 查询支付列表
     *
     * @param query 支付
     * @return 支付集合
     */
    public List<BizUserRechargePaymentVO> selectBizUserRechargePaymentList(BizUserRechargePaymentQueryVO query);

    /**
     * 新增支付
     *
     * @param form 支付
     * @return 结果
     */
    public boolean insertBizUserRechargePayment(BizUserRechargePaymentFormVO form);

    /**
     * 修改支付
     *
     * @param form 支付
     * @return 结果
     */
    public boolean updateBizUserRechargePayment(BizUserRechargePaymentFormVO form);

    /**
     * 批量删除支付
     *
     * @param ids 需要删除的支付主键集合
     * @return 结果
     */
    public boolean deleteBizUserRechargePaymentByIds(Long[] ids);

    /**
     * 更改状态
     *
     * @param vo 更改状态表单
     * @return 结果
     */
    boolean changeStatus(BizStatusChangeVO vo);

    /**
     * 生成payment
     * @param rechargeSerialNumber
     * @param form
     * @param userId
     * @return
     */
    BizUserRechargePayment createRechargePayment(String rechargeSerialNumber, AppUserRechargeFormVO form, Long userId);
    /**
     * 支付成功
     * @param tradeNo
     * @param aliTradeNo
     * @param date
     */
    void paySuccess(String tradeNo, String aliTradeNo, Date date);

    /**
     * 构造交保证金的payment
     * @param userEnsureMoney
     * @param user
     * @return
     */
    BizUserRechargePayment createEnsureMoneyPayment(BizUserEnsureMoney userEnsureMoney, SysUser user);

}
